{include file="public/layout" /}
<script type="text/javascript" src="__SKIN__/js/clipboard.min.js"></script>
<body class="eyou_body_xin">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
{include file="order/left" /}
<div id="geduan_div" class="h15"></div>
<div class="page" style="min-width:auto;margin-left:115px;padding-bottom: 15px;">
    <div class="fixed-bar">
        <div class="item-title">
            <ul class="tab-base nc-row">
                <li><a href='{:url("OrderVerify/index")}' {if condition="'index' == $Think.const.ACTION_NAME" }
                       class="current" {/if}>核销订单</a> </li>
                <li><a href='{:url("OrderVerify/verification")}' {if
                       condition="'verification' == $Think.const.ACTION_NAME" } class="current" {/if}>核销台</a> </li>
            </ul>
            <!-- <div class="fr e-export">
                <a href="javascript:void(0);" onclick="OrderExcelExport(this);" data-url="{:url('Order/ajax_order_excel_export')}" class=""><i class="iconfont e-XLStubiao"></i>导出订单</a>
            </div> -->
        </div>
    </div>
    <div class="flexigrid flexigrid-xin">
        <div id="explanation" class="explanation"
             style="color: rgb(44, 188, 163); background-color: rgb(237, 251, 248); width: 99%; height: 100%;margin-bottom: 15px;">
            <div id="checkZoom" class="title"><i class="fa fa-lightbulb-o"></i>
                <h4 title="提示相关设置操作时应注意的要点">提示</h4>
                <span title="收起提示" id="explanationZoom" style="display: block;"></span>
            </div>
            <ul>
                <li>1，搜索核销码：请顾客出示核销码并点击“核销台”， 输入核销码，点击查询</li>
                <li>2，核销：查询完成后，点击核销完成商品核销</li>
            </ul>
        </div>
        <div class="header-bar">
            <div class="more">
                <div class="search">
                    <div class="content">
                        <form id="searchForm" action="{:url('OrderVerify/verification')}" method="get"
                              onsubmit="layer_loading('正在处理');" style="display: unset;">
                            {$searchform.hidden|default=''}
                            <div class="ey-form-item"><label class="users-form-item-label">核销码：</label>
                                <div class="users-form-item-content">
                                    <div class="users-select">
                                        <div tabindex="0" class="users-select-selection">
                                            <!-- 订单号查询 -->
                                            <div class="sDiv2">
                                                <input type="text" size="50" name="verify_code"
                                                       value="{$Request.param.verify_code}" class="qsbox"
                                                       style="width: 170px;" placeholder="请输入核销码">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                        <div class="ey-form-item" style="margin-left: 20px;">
                            <div class="users-form-item-content">
                                <span class="bt-xin" id="submitForm" onclick="$('#searchForm').submit();">查询</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="geduan-xin"></div>

    <div class="flexigrid" style=" padding-right: 1px; ">
        <div class="mDiv">
            <div class="ftitle">
                <h3>商品信息</h3>
            </div>
        </div>
    </div>
    <div class="flexigrid flexigrid-xin" style=" padding-right: 1px; ">
        <div class="tableDiv  bubbleInfo mt5">
            <table cellspacing="0" cellpadding="0" border="0" style="width: 100%;">
                <thead>
                <tr>
                    <th class="">
                        <div class="">商品名称</div>
                    </th>
                    <th class="w240 tc">
                        <div class="">单价/数量</div>
                    </th>
                </tr>
                </thead>
                <tbody>
                {empty name="DetailsData"}
                <tr>
                    <td class="no-data" align="center" axis="col0" colspan="50">
                        <div class="">
                            <div class="no_pic"><img src="__SKIN__/images/null-data.png"></div>
                        </div>
                    </td>
                </tr>
                {else/}
                    {foreach name="DetailsData" item="vo" key="k" }
                    <tr class="order-empty">
                        <td></td>
                    </tr>
                    <tr class="order-empty">
                        <td class="pl0">
                            <div class="goods-detail pl0">
                                <div class="goods-image">
                                    <img src="{$vo.litpic}">
                                </div>
                                <div class="goods-info">
                                    <p class="goods-title">{$vo.product_name}</p>
                                    <p class="goods-spec">
                                        <span class="eyou_product_spec">{$vo.product_spec}</span>
                                </div>
                            </div>
                        </td>
                        <td class="tc">
                            <p>￥{$vo.product_price} x {$vo.num}</p>
                        </td>
                    </tr>
                    {/foreach}
                {/empty}
                </tbody>
            </table>
        </div>
        {notempty name="$OrderData"}
        <div class="order-total">
            <div class="order-total-box">
                <div class="order-total-con">
                    <div class="total-name"> 商品小计：</div>
                    <div class="total-value"> ￥{$OrderData.order_total_amount}</div>
                </div>
                {eq name="$OrderData.order_source" value="10"}
                {notempty name="$OrderData.coupon_id"}
                <div class="order-total-con">
                    <div class="total-name"> 优惠券：</div>
                    <div class="total-value"> -￥{$OrderData.coupon_price}</div>
                </div>
                {/notempty}
                {gt name="$OrderData.pay_use_scores" value="0"}
                <div class="order-total-con">
                    <div class="total-name"> 积分抵扣：</div>
                    <div class="total-value">(使用{$OrderData.pay_use_scores_num}积分) -￥{$OrderData.pay_use_scores}</div>
                </div>
                {/gt}
                {gt name="$OrderData.pay_use_balance" value="0"}
                <div class="order-total-con">
                    <div class="total-name"> 余额抵扣：</div>
                    <div class="total-value"> -￥{$OrderData.pay_use_balance}</div>
                </div>
                {/gt}
                <div class="order-total-con actual-payment">
                    <div class="total-name"> 实付款：</div>
                    <div class="total-value"> ￥{$OrderData.pay_use_cash}</div>
                </div>
                {/eq}
                <div class="order-total-con mt10">
                    <div class="total-name"> 用户姓名：</div>
                    <div class="total-value"> {$verify_data.name}</div>
                </div>
                <div class="order-total-con">
                    <div class="total-name"> 联系电话：</div>
                    <div class="total-value"> {$verify_data.mobile}</div>
                </div>
                <div class="order-total-con">
                    <div class="total-name"> 订单编号：</div>
                    <div class="total-value"> {$OrderData.order_code}</div>
                </div>
                <div class="order-total-con">
                    <div class="total-name"> 创建时间：</div>
                    <div class="total-value"> {$OrderData.add_time|MyDate='Y-m-d H:i:s',###}</div>
                </div>
                <div class="order-total-con">
                    <div class="total-name"> 付款时间：</div>
                    <div class="total-value"> {$OrderData.pay_time|MyDate='Y-m-d H:i:s',###}</div>
                </div>
                <div class="order-total-con mt10">
                    <div class="total-name"></div>
                    <div class="total-value">
                        {if condition="$OrderData.order_status == 2"}
                        <a class="lumping-btn-big lumping-btn-green mr10" style="height: 34px;" href="JavaScript:void(0);" onclick="verify(this);" data-url="{:url('OrderVerify/verify',['order_id'=>$OrderData.order_id])}">立即核销</a>
                        {elseif condition="$OrderData.order_status == 3" /}
                        <a class="lumping-btn-big lumping-btn-gray mr10" style="height: 34px;">已核销</a>
                        {/if}
                    </div>
                </div>
            </div>
        </div>
        {/notempty}
    </div>

</div>

<script type="text/javascript">
    function verify(obj){
        layer.confirm('确认核销？', {
            area: ['480px', '190px'],
            move: false,
            title: '提示',
            shade: layer_shade,
            btnAlign:'r',
            closeBtn: 3,
            btn: ['确定','取消'] ,//按钮
            success: function () {
                $(".layui-layer-content").css('text-align', 'left');
            }
        }, function () {
            layer_loading('正在处理');
            $.ajax({
                type: "POST",
                url: $(obj).attr('data-url'),
                data: {_ajax:1},
                dataType: 'json',
                success: function (data) {
                    layer.closeAll();
                    if(parseInt(data.code) == 1){
                        layer.msg(data.msg, {icon: 1});
                        $('#searchForm').submit();
                    }else{
                        layer.alert(data.msg, {icon: 5});
                    }
                },
                error:function(e){
                    layer.closeAll();
                    layer.alert(e.responseText, {icon: 5});
                }
            });
        }, function (index) {
            layer.closeAll(index);
        });
    }

    $(function () {
        $(document).keydown(function (event) {
            if (event.keyCode == 13) {
                $('#searchForm input[type=text]').each(function (index, item) {
                    if ($(item).is(':focus')) {
                        $('#searchForm').submit();
                    }
                });
            }
        });

        $('input[name*=ids]').click(function () {
            if ($('input[name*=ids]').length == $('input[name*=ids]:checked').length) {
                $('.checkAll').prop('checked', 'checked');
            } else {
                $('.checkAll').prop('checked', false);
            }
        });
        $('input[type=checkbox].checkAll').click(function () {
            $('input[type=checkbox]').prop('checked', this.checked);
        });
    });

    $(document).ready(function () {
        // 表格行点击选中切换
        $('#flexigrid > table>tbody >tr').click(function () {
            $(this).toggleClass('trSelected');
        });
    });


    // 订单号复制
    function addressCopy() {
        var clipboard1 = new Clipboard(".address_code");
        clipboard1.on("success", function (e) {
            layer.msg("复制成功");
        });
        clipboard1.on("error", function (e) {
            layer.msg("复制失败！请手动复制", {icon: 5});
        });
    }

    // 订单号复制
    function OrderCopy() {
        var clipboard1 = new Clipboard(".order_code");
        clipboard1.on("success", function (e) {
            layer.msg("复制成功");
        });
        clipboard1.on("error", function (e) {
            layer.msg("复制失败！请手动复制", {icon: 5});
        });
    }

</script>

<!-- 日期联动选择js文件 start -->
{eyou:static file="__PUBLIC__/static/common/js/ey_laydate_time_linkage.js"/}
<!-- 日期联动选择js文件 end -->
{include file="public/footer" /}
<script type="text/javascript">
    try {
        var mt20_1649209614 = sessionStorage.getItem("mt20_1649209614");
        if (mt20_1649209614 == 1) {
            $("#geduan_div").removeClass("h15");
        } else {
            $("#geduan_div").addClass("h15");
        }
    } catch (e) {
    }
</script>